# variables
OZFFILES = Field.ozf Game.ozf LazySearch.ozf BinCons.ozf SetCons.ozf \
           BuildImages.ozf Images.ozf
OZAFILES = Minesweeper.ozf Minesweeper.oza
EXECUTABLE = Minesweeper

.SUFFIXES: .oz .ozf .oza

# change this for another main target
all: ozf exec

# target shorthands
ozf: $(OZFFILES)
oza: ozf $(OZAFILES)
exec: $(EXECUTABLE)

# specific build of Images.ozf
Images.ozf: BuildImages.ozf
	ozengine BuildImages.ozf

# generic functor compilation
.oz.ozf:
	ozc -c $<

# generic functor linking
.ozf.oza:
	ozl --compress 9 $< -o $@

# compile executable
Minesweeper: Minesweeper.oz
	ozc -x Minesweeper.oz

clean:
	rm -f $(OZFFILES) $(OZAFILES) $(EXECUTABLE)
